package emas.shared;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Time;

public class SensorData implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7086788296914507034L;
	private int recordID;
	private int locationID;
	private String sensor;
	private float avgTemp;

	private Date date;
	private Time time;

	public SensorData(int recordID, int locationID, String sensor,
			float avgTemp, Date date, Time time) {
		super();
		this.recordID = recordID;
		this.locationID = locationID;
		this.sensor = sensor;
		this.avgTemp = avgTemp;
		this.date = date;
		this.time = time;
	}

	public SensorData() {

	}

	public int getRecordID() {
		return recordID;
	}

	public int getLocationID() {
		return locationID;
	}

	public String getSensor() {
		return sensor;
	}

	public float getAvgTemp() {
		return avgTemp;
	}

	public Date getDate() {
		return date;
	}

	public Time getTime() {
		return time;
	}

	public void setLocationID(int locationID) {
		this.locationID = locationID;
	}

	public void setSensor(String sensor) {
		this.sensor = sensor;
	}

	public void setAvgTemp(float avgTemp) {
		this.avgTemp = avgTemp;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public void setTime(Time time) {
		this.time = time;
	}

	public void setRecordID(int recordID) {
		this.recordID = recordID;
	}
	
	@Override
	public int hashCode() {
		return sensor.hashCode();
	}

	@Override
	public boolean equals(Object arg0) {
		SensorData data = (SensorData)arg0;
		return data.getSensor().equals(sensor);
	}
}
